package com.rockcent.mall.lib.repository;

import com.rockcent.common.common.PageResult;
import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.IntegrationCouponWallet;
import com.rockcent.mall.lib.dto.IntegrationChannelDto;
import com.rockcent.mall.lib.dto.IntegrationCouponDetailRespDto;
import com.rockcent.mall.lib.dto.IntegrationCouponRespDto;
import com.rockcent.mall.lib.dto.IntegrationCouponWalletDto;

import java.util.List;

/**
 * Created by zhangjh on 2016/12/14.
 */
public interface IntegrationCouponWalletRepositoryCustom {
    /**
     *
     * @param cashCouponId
     * @param integrationChannelId
     * @param mallId
     * @return
     */
    IntegrationCouponWallet caculateCoupon(Long cashCouponId, Long integrationChannelId, Long mallId);

    /**
     *
     * @param dto
     * @param mallId
     * @param whether
     * @param page
     * @return
     */
    PageResult<IntegrationCouponWalletDto> findChannelCouponDetail(IntegrationChannelDto dto, Long mallId, Whether whether, PageResult page);

    /**
     *
     * @param dto
     * @param mallId
     * @param whether
     * @return
     */
    Long qrExchangeNumByChannelId(IntegrationChannelDto dto, Long mallId, Whether whether);

    /**
     *
     * @param merchantCouponId
     * @param mallId
     */
    void stop(Long merchantCouponId, Long mallId);

    /**
     *
     * @param merchantCouponId
     * @param channelId
     * @param mallId
     * @param batchPutNo
     * @param merchantName
     */
    void updateIntegrationChannelId(Long merchantCouponId, Long channelId, Long mallId, Long batchPutNo, String merchantName);

    /**
     *
     * @param chnnelId
     * @return
     */
    List<IntegrationCouponRespDto> queryList(Long chnnelId);

    /**
     *
     * @param exchangeCode
     * @return
     */
    IntegrationCouponWallet findByExchangeCode(String exchangeCode);

    /**
     *
     * @param dto
     * @param mallId
     * @param no
     * @return
     */
    Double qrExchangeNumCouponAmountByChannelId(IntegrationChannelDto dto, Long mallId, Whether no);

    /**
     *
     * @param couponId
     * @return
     */
    List<IntegrationCouponDetailRespDto> findByCounponId(Long couponId);


    /**
     *
     * @param exchangeCode
     * @param integrationChannelId
     * @param no
     * @return
     */
    IntegrationCouponWallet findByExchangeCodeAndIntegrationChannelIdAndIsDelete(String exchangeCode, Long integrationChannelId, Whether no);
}
